﻿<Window x:Class="WPFToolbeltDemoApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WPF Toolbelt Demo" 
    xmlns:local="clr-namespace:WPFToolbeltDemoApp" 
    xmlns:SG="clr-namespace:PlanetWPF.Toolbelt.Controls;assembly=WPFToolbelt"
    xmlns:Util="clr-namespace:PlanetWPF.Toolbelt.Utils;assembly=WPFToolbelt"
  >

    <Window.Resources>
        <ObjectDataProvider ObjectType="{x:Type local:ContactTest}" x:Key="odp1"/>
        <ObjectDataProvider ObjectType="{x:Type local:ObjectInvokerTest}" x:Key="odp2"/>
    </Window.Resources>
    <Util:CommandBindingAdapter.AttachCommand>
        <Util:CommandBindingAdapter
            Command="ApplicationCommands.Open" 
            Executed="{Util:ExecutedHandler Target={StaticResource odp2}, Handler=InvokeCommand}"/>
    </Util:CommandBindingAdapter.AttachCommand>

    <StackPanel Orientation="Vertical">
        <SG:PowerGrid Name="PowerGrid" Items="{Binding Source={StaticResource odp1}, Path=Contacts}" >
            <SG:PowerGrid.Columns>
                <SG:PowerGridColumn Width="25" ColumnPath="ColHeader" ColumnType="RowHeader" />
                <SG:PowerGridColumn Width="500" ColumnPath="ImagePath" ColumnType="Image"  DisplayName="Image"/>
                <SG:PowerGridColumn Width="100" ColumnPath="FirstName" DisplayName="First Name" />
                <SG:PowerGridColumn Width="100" ColumnPath="LastName" DisplayName="Last Name"/>
                <SG:PowerGridColumn Width="100" ColumnPath="Extension" DisplayName="Extension"/>
            </SG:PowerGrid.Columns>
        </SG:PowerGrid>

        <Button Command="Copy"
            CommandTarget="{Binding ElementName=PowerGrid}"
            Content="Copy Cells"/>
        <Button Command="Paste"
            CommandTarget="{Binding ElementName=PowerGrid}"
            Content="Paste Rows"/>
        <SG:PowerDatePicker Name="dtp" Value="22-jan-2007"  />
        <SG:PowerDatePicker Name="dtp2" Value="22-feb-2007" />
        <Button Content="Mark" />
        <ListView ItemsSource="{Binding Source={StaticResource odp1}, Path=Contacts}">
            <ListView.View>
                <GridView>
                    <GridViewColumn DisplayMemberBinding="{Binding FirstName}"/>
                    <GridViewColumn DisplayMemberBinding="{Binding LastName}" Util:GridViewHelper.MaxColumnWidth="60" />
                </GridView>
            </ListView.View>
        </ListView>
    </StackPanel>
</Window>
